//实现延迟执行任务
function Bomb(id){
  var id1=id,timeId;
  this.start=() => {
    console.log(id1+'will bomb after 3 second');
    timeId=setTimeout(() => {
      console.log(id1+'bomb!');
    },3000);
  }
  this.clear=() => {clearTimeout(timeId)}
}

var bomb1=new Bomb(1);
bomb1.start();

var bomb2=new Bomb(2);
bomb2.start();
setTimeout(bomb2.clear,1000);
